import 'package:flutter/material.dart';
typedef onPressedCallback = void Function();

class ComponentCustomButtonBlock extends StatelessWidget {
  final String title;
  final Color bgcolor;
  final onPressedCallback? onPressed;

  const ComponentCustomButtonBlock(this.title,
      {Key? key, this.bgcolor = Colors.blueAccent, this.onPressed})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: double.infinity,
      child: ElevatedButton(
        onPressed: onPressed,
        style: Theme.of(context).elevatedButtonTheme.style?.copyWith(
            // backgroundColor: MaterialStatePropertyAll(bgcolor),
            padding:
                MaterialStatePropertyAll(EdgeInsets.symmetric(vertical: 11)),
            foregroundColor: MaterialStatePropertyAll(Colors.white)),
        child: Text(title),
      ),
    );
  }
}
